Repository navigation
fix(fleet-proxy): bound HttpConn response sizes, fail malformed Content-Length - #5587
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Fixes #5579 (task 9671).
fleet-proxy's pooled
HttpConnresponse reader trusted peer-declared sizes and misparsed malformed length headers:HttpError::Malformedand mark the connection non-reusable, instead of silently reading as "no body" and desyncing the pooled connection. Agreeing duplicates are accepted.MAX_RESPONSE_BODY_BYTES(64 MiB, matching fleet-proxy-proto'sMAX_FRAME_BYTESceiling) is enforced before any allocation sized by the declaration — on the Content-Length path (at header parse), on the chunked path (per chunk and cumulative), and on the close-delimitedread_to_endpath.read_line_bounded(MAX_LINE_BYTES, 64 KiB, matching the tunnel CONNECT response cap precedent) instead of unboundedread_line.Tests: 9 new canned-loopback pins in
http.rs(invalid CL, conflicting duplicates, agreeing duplicates, oversize declared CL with no body sent, oversize chunk, cumulative-over-cap chunked, overlong status line, well-formed CL two-exchange reuse, well-formed chunked reuse).Verification:
cargo test -p fleet-proxy(pkgs/fleet workspace, laptop) — 22 passed, 0 failed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit